clear all;

DPsummary = cell(9,7);
DPsummary{1,1} = 'DetecPower summary';
DPsummary{2,1} = 'Face1';
DPsummary{3,1} = 'Face2';
DPsummary{4,1} = 'Face3';
DPsummary{5,1} = 'Face4';
DPsummary{6,1} = 'Color1';
DPsummary{7,1} = 'Color2';
DPsummary{8,1} = 'Color3';
DPsummary{9,1} = 'Color4';
DPsummary{1,2} = '1-back';
DPsummary{1,3} = '2-back';
DPsummary{1,4} = '3-back';
DPsummary{1,5} = '4-back';
DPsummary{1,6} = '5-back';
DPsummary{1,7} = '6-back';

allCovs = GenerateCovariates_ShortTerm;


for i=1:4
    
    eval(['carryOver1 = allCovs.Face' num2str(i) '.carryOver1;']);
    eval(['carryOver2 = allCovs.Face' num2str(i) '.carryOver2;']);
    eval(['carryOver3 = allCovs.Face' num2str(i) '.carryOver3;']);
    eval(['carryOver4 = allCovs.Face' num2str(i) '.carryOver4;']);
    eval(['carryOver5 = allCovs.Face' num2str(i) '.carryOver5;']);
    eval(['carryOver6 = allCovs.Face' num2str(i) '.carryOver6;']);
    
    carryOver1(carryOver1==-1) = 1000;
    carryOver1(carryOver1==0) = -1;
    carryOver1(carryOver1==1000) = 0;
    carryOver2(carryOver2==-1) = 1000;
    carryOver2(carryOver2==0) = -1;
    carryOver2(carryOver2==1000) = 0;
    carryOver3(carryOver3==-1) = 1000;
    carryOver3(carryOver3==0) = -1;
    carryOver3(carryOver3==1000) = 0;
    carryOver4(carryOver4==-1) = 1000;
    carryOver4(carryOver4==0) = -1;
    carryOver4(carryOver4==1000) = 0;
    carryOver5(carryOver5==-1) = 1000;
    carryOver5(carryOver5==0) = -1;
    carryOver5(carryOver5==1000) = 0;
    carryOver6(carryOver6==-1) = 1000;
    carryOver6(carryOver6==0) = -1;
    carryOver6(carryOver6==1000) = 0;
    
    DPsummary{i+1,2} = evalSeq(carryOver1,1600);
    DPsummary{i+1,3} = evalSeq(carryOver2,1600);
    DPsummary{i+1,4} = evalSeq(carryOver3,1600);
    DPsummary{i+1,5} = evalSeq(carryOver4,1600);
    DPsummary{i+1,6} = evalSeq(carryOver5,1600);
    DPsummary{i+1,7} = evalSeq(carryOver6,1600);
    
end

for i=1:4
    
    eval(['carryOver1 = allCovs.Color' num2str(i) '.carryOver1;']);
    eval(['carryOver2 = allCovs.Color' num2str(i) '.carryOver2;']);
    eval(['carryOver3 = allCovs.Color' num2str(i) '.carryOver3;']);
    eval(['carryOver4 = allCovs.Color' num2str(i) '.carryOver4;']);
    eval(['carryOver5 = allCovs.Color' num2str(i) '.carryOver5;']);
    eval(['carryOver6 = allCovs.Color' num2str(i) '.carryOver6;']);
    
    carryOver1(carryOver1==-1) = 1000;
    carryOver1(carryOver1==0) = -1;
    carryOver1(carryOver1==1000) = 0;
    carryOver2(carryOver2==-1) = 1000;
    carryOver2(carryOver2==0) = -1;
    carryOver2(carryOver2==1000) = 0;
    carryOver3(carryOver3==-1) = 1000;
    carryOver3(carryOver3==0) = -1;
    carryOver3(carryOver3==1000) = 0;
    carryOver4(carryOver4==-1) = 1000;
    carryOver4(carryOver4==0) = -1;
    carryOver4(carryOver4==1000) = 0;
    carryOver5(carryOver5==-1) = 1000;
    carryOver5(carryOver5==0) = -1;
    carryOver5(carryOver5==1000) = 0;
    carryOver6(carryOver6==-1) = 1000;
    carryOver6(carryOver6==0) = -1;
    carryOver6(carryOver6==1000) = 0;
    
    DPsummary{i+5,2} = evalSeq(carryOver1,1600);
    DPsummary{i+5,3} = evalSeq(carryOver2,1600);
    DPsummary{i+5,4} = evalSeq(carryOver3,1600);
    DPsummary{i+5,5} = evalSeq(carryOver4,1600);
    DPsummary{i+5,6} = evalSeq(carryOver5,1600);
    DPsummary{i+5,7} = evalSeq(carryOver6,1600);
    
end